<template>
  <div>
    分析页
    <Chart style="height:400px" :option="chartOpiton"/>
  </div>
</template>

<script>
import random from 'lodash/random'
import Chart from '../../components/Chart'
export default {
  name: '',
  data () {
    return {
      chartOpiton:{
      
    }
    }
  },

  components: {
    Chart
  },
  computed: {},
  methods: {
    getChartData() {
      this.$request({
        url:'/api/dashboard/chart',
        method: 'get',
        params:{ID: 12345}
      }).then(res =>{
        this.chartOpiton = {
          title: {
        text: "ECharts 入门示例",
      },
      tooltip: {},
      legend: {
        data: ["销量"],
      },
      xAxis: {
        data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
      },
      yAxis: {},
      series: [
        {
          name: "销量",
          type: "bar",
          data: res.data,
        },
      ],
        }
      })
    }
  },
  created() {},
  mounted() {
    this.getChartData()
  },
  beforeDestroy() {
  }
}
</script>

<style lang="less" scoped>
</style>